/* 入口文件 */
import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import style from './main.css'
import {Navicat , Home , Product , News , Cart , DetailPro , DetailNews} from './components';
import {HashRouter as Router,Route,Switch} from 'react-router-dom';
/* import 'bootstrap/dist/css/bootstrap.min.css'; */
import { Provider} from 'react-redux'
import store from './store'
                                     
class Index extends Component{
    render(){
        return (
            <Router>
                <div>
                    <Navicat/>
                    <Switch>
                        <Route path="/" component={Home} exact/>
                        <Route path="/product/:id" component={DetailPro}/>
                        <Route path="/product" component={Product}/>
                        <Route path="/news/:id" component={DetailNews}/>
                        <Route path="/news" component={News}/>
                        <Route path="/cart" component={Cart}/>
                    </Switch>
                </div>
            </Router>
        )
   }
}

ReactDOM.render(
    //6.将store和容器组件连接
    <Provider store={store}>
        <Index/>
    </Provider>
,document.getElementById('app'));